<!DOCTYPE HTML>
<html lang="en">
<head>
<meta content="text/html;" http-equiv="content-type" charset="utf-8">
<link href="<?php echo base_url(); ?>images/icono.ico"
	rel="shortcut icon" type="image/x-icon">
<title><?php echo $page_title?></title>

<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
<link rel="stylesheet" href="<?php echo base_url(); ?>css/skel.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>css/style.css" />
<link rel="stylesheet"
	href="<?php echo base_url(); ?>css/style-desktop.css" />
<link rel="stylesheet"
	href="<?php echo base_url(); ?>css/style-wide.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>css/tabs.css" />
<link rel="stylesheet"
	href="<?php echo base_url(); ?>css/jquery.lightbox-0.5.css" />
<!--ALERTAS-->
<link rel="stylesheet" href="<?php echo base_url(); ?>css/estilo.css" />

<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.min.js"></script>
<!-- <script type="text/javascript" src="<?php echo base_url(); ?>js/modernizr.custom.04022.js"></script>  -->
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/skel.min.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/skel-layers.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/init.js"></script>

<!--Estilos para el datatable-->
<style type="text/css" title="currentStyle">
@import "<?php echo base_url(); ?>css/demo_page.css";

@import "<?php echo base_url(); ?>css/demo_table.css";

@import "<?php echo base_url(); ?>css/demo_table_jui.css";

@import
	"<?php echo base_url(); ?>themes/smoothness/jquery-ui-1.8.4.custom.css"
	;

@import "<?php echo base_url(); ?>css/dataTables.colVis.nightly.css";

@import "<?php echo base_url(); ?>css/dataTables.tableTools.css";
</style>

<!-- CARGA -->
<!-- <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> -->
<link href="<?php echo base_url(); ?>css/fileinput.css" media="all"
	rel="stylesheet" type="text/css" />
<script src="<?php echo base_url(); ?>js/fileinput.min.js"
	type="text/javascript"></script>

<!--Llamando a los js son para el datatable-->
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery-1.11.1.min.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui.js"></script>
<script type="text/javascript" 
	src="<?php echo base_url(); ?>js/jquery.dataTables.columnFilter.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/dataTables.colVis.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/dataTables.tableTools.js"></script>
<!-- <script type="text/javascript" src="<?php echo base_url(); ?>js/ZeroClipboard.js"></script> -->
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/hideshow.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.lightbox-0.5.min.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.MultiFile.js"></script>
<!--Las Tablas que tengan el id="example" se aplicara datatables"-->
<script type="text/javascript" src="<?php echo base_url();?>ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>ckeditor/adapters/jquery.js"></script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
			$('#example_responsable').DataTable({
					"bJQueryUI": true,
					"scrollX": true,
					"sPaginationType": "full_numbers",
					"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]]
				});
		});
</script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
			$('#example_parametro').DataTable({
					"bJQueryUI": true,
					"scrollX": true,
					"sPaginationType": "full_numbers",
					"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]]
				});
		});
</script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
			$('#example_perfil').DataTable({
					"bJQueryUI": true,
					"scrollX": true,
					"sPaginationType": "full_numbers",
					"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]]
				});
		});
</script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
			$('#example_opciones').DataTable({
					"bJQueryUI": true,
					"scrollX": true,
					"sPaginationType": "full_numbers",
					"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]]
				});
		});
</script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function(){
			$('#example_repuesto').DataTable({
					"bJQueryUI": true,
					"scrollX": true,
					"sPaginationType": "full_numbers",
					"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]]
				});
		});
</script>

<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			$.datepicker.regional[""].dateFormat = 'dd/mm/yy';
	        $.datepicker.setDefaults($.datepicker.regional['']);
			$('#example').dataTable({
        		"bJQueryUI": true,
        		"scrollX": true,
        		"sPaginationType": "full_numbers",
        		"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]]
        	});	
        	$('#example').dataTable()
        		.columnFilter({
            			sPlaceHolder: "head:before",
            			aoColumns: [ {type: "date-range"},
            			             {type: "date-range"}
                        		   ]
            		});		
    	});
	</script>

<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			$.datepicker.regional[""].dateFormat = 'dd/mm/yy';
			$.datepicker.setDefaults($.datepicker.regional['']);
	    	$('#reporte_oc').DataTable( {
	    		"bJQueryUI": true,	        
	        	"scrollX": true,
	        	"sPaginationType": "full_numbers",
	        	"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]],
	        	"dom": 'TC<"clear">lfrtip',
	        	"tableTools": {
	        		"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.3/swf/copy_csv_xls_pdf.swf",
	        		//"sRowSelect": "single",//single o multi
		        	"aButtons": [
	            		{
	            			'sExtends':'xls',
	            			"sFileName": "Reporte_Orden_Compra_<?php echo date('d-m-Y');?>.xls",
	            			"sButtonText": "EXPORTAR A EXCEL",
	            			'mColumns':'visible',
	            			"oSelectorOpts": {
	            				filter: 'applied', order: 'current', page: 'all'
	                		}
	            		}
					]
				}
	    	} );
	    	$('#reporte_oc').dataTable()
	    		.columnFilter({
		    			sPlaceHolder: "head:before",
		    			aoColumns: [{type: "date-range"},
		    		    			{type: "date-range"}]
		    		});
		} );
	</script>

<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			$.datepicker.regional[""].dateFormat = 'dd/mm/yy';
	        $.datepicker.setDefaults($.datepicker.regional['']);
	    	$('#reporte').DataTable( {
	    		"bJQueryUI": true,	        
	        	"scrollX": true,
	        	"sPaginationType": "full_numbers",
	        	"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]],
	        	"dom": 'TC<"clear">lfrtip',
	        	"tableTools": {
	        		"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.3/swf/copy_csv_xls_pdf.swf",
	        		//"sRowSelect": "single",//single o multi
		        	"aButtons": [
	            		{
	            			'sExtends':'xls',
	            			"sFileName": "Reporte_Cotizacion_<?php echo date('d-m-Y');?>.xls",
	            			"sButtonText": "EXPORTAR A EXCEL",
	            			'mColumns':'visible',
	            			"oSelectorOpts": {
	            				filter: 'applied', order: 'current', page: 'all'
	                		}
	            		}
					]
				}
	    	} );
	    	$('#reporte').dataTable()
	    		.columnFilter({
		    			sPlaceHolder: "head:before",
		    			aoColumns: [{type: "date-range"},
		    		    			{type: "date-range"}
		    					   ]
		    		});
		} );
	</script>
	
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			$.datepicker.regional[""].dateFormat = 'dd/mm/yy';
	        $.datepicker.setDefaults($.datepicker.regional['']);
	    	$('#reporte_proveedor').DataTable( {
	    		"bJQueryUI": true,	        
	        	"scrollX": true,
	        	"sPaginationType": "full_numbers",
	        	"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]],
	        	"dom": 'TC<"clear">lfrtip',
	        	"tableTools": {
	        		"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.3/swf/copy_csv_xls_pdf.swf",
	        		//"sRowSelect": "single",//single o multi
		        	"aButtons": [
	            		{
	            			'sExtends':'xls',
	            			"sFileName": "Reporte_Proveedor_<?php echo date('d-m-Y');?>.xls",
	            			"sButtonText": "EXPORTAR A EXCEL",
	            			'mColumns':'visible',
	            			"oSelectorOpts": {
	            				filter: 'applied', order: 'current', page: 'all'
	                		}
	            		}
					]
				}
	    	} );
	    	$('#reporte_proveedor').dataTable()
	    		.columnFilter({
		    			sPlaceHolder: "head:before",
		    			aoColumns: [{type: "date-range"},
		    		    			{type: "date-range"}]
		    		});
		} );
	</script>

<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
	    	$('#detalle_oc').DataTable( {
	    		"bJQueryUI": true,	        
	        	"scrollX": true,
	        	"sPaginationType": "full_numbers",
	        	"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]],
	        	"dom": 'T<"clear">lfrtip',
	        	"tableTools": {
	        		"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.3/swf/copy_csv_xls_pdf.swf",
	        		//"sRowSelect": "single",//single o multi
		        	"aButtons": [
	            		{
	            			'sExtends':'xls',
	            			"sFileName": "Detalle_Orden_Compra_<?php echo date('d-m-Y');?>.xls",
	            			"sButtonText": "EXPORTAR A EXCEL",
	            			"oSelectorOpts": {
	            				filter: 'applied', order: 'current', page: 'all'
	                		}
	            		}
					]
				}
	    	} );
		} );
	</script>
	
<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
	    	$('#detalle').DataTable( {
	    		"bJQueryUI": true,	        
	        	"scrollX": true,
	        	"sPaginationType": "full_numbers",
	        	"lengthMenu": [[5, 10, 25, 50, -1], ["05", "10", "25", "50", "Todo"]],
	        	"columnDefs": [
	        		{
	        	    	"targets": [ 1 ],
	        	    	"visible": false,
	        	    	"searchable": false
	        		},
	        		{
	        	    	"targets": [ 7 ],
	        	    	"visible": false,
	        	    	"searchable": false
	        		}
	        	],
	        	"dom": 'T<"clear">lfrtip',
	        	"tableTools": {
	        		"sSwfPath": "http://cdn.datatables.net/tabletools/2.2.3/swf/copy_csv_xls_pdf.swf",
	        		//"sRowSelect": "single",//single o multi
		        	"aButtons": [
	            		{
	            			'sExtends':'xls',
	            			"sFileName": "Detalle_Cotizacion_<?php echo date('d-m-Y');?>.xls",
	            			"sButtonText": "EXPORTAR A EXCEL",
	            			"oSelectorOpts": {
	            				filter: 'applied', order: 'current', page: 'all'
	                		}
	            		}
					]
				}
	    	} );
		} );
	</script>

<script type="text/javascript">
		function cambiaModelo (select) {
			var selectedOption = select.options[select.selectedIndex];
    		//alert ("The selected option is " + selectedOption.value);
    		$('#modelo').load('cargarModelo?cbxMarca='+selectedOption.value);
		}
	
		function cambiaDocumento (select) {
			var selectedOption = select.options[select.selectedIndex];
    		//alert ("The selected option is " + selectedOption.value);
    		$('#doc').load('cargarDocumento?cbxDocumento='+selectedOption.value);
		}

		function cambiaDocumentoProveedor (select) {
			var selectedOption = select.options[select.selectedIndex];
    		//alert ("The selected option is " + selectedOption.value);
    		$('#doc').load('cargarDocumentoProveedor?cbxDocumento='+selectedOption.value);
		}
	
		function cambiaProvincia (select) {
    		var selectedOption = select.options[select.selectedIndex];
        	//alert ("The selected option is " + selectedOption.value);
        	$('#pro').load('cargarProvincia?cbxDepartamento='+selectedOption.value);
    	}
    	
		function cambiaProvinciaCliente (select) {
    		var selectedOption = select.options[select.selectedIndex];
        	//alert ("The selected option is " + selectedOption.value);
        	$('#pro').load('cargarProvinciaCliente?cbxDepartamento='+selectedOption.value);
    	}

		function cambiaDistrito () {
			/*
	    	 * 02/06/2015
	    	 se llamo a provincia y departamento por medio de variables y luego
	    	 se las paso a la funcion cargarDistrito 	 
	    	 */	    	 
			var prov = document.Rproveedor.cbxProvincia.value;  
			var dept = document.Rproveedor.cbxDepartamento.value;    		
    		$('#dis').load('cargarDistrito?prov='+prov+'&dept='+dept);
		}   

		function cambiaDistritoCliente () {
			/*
	    	 * 02/06/2015
	    	 se llamo a provincia y departamento por medio de variables y luego
	    	 se las paso a la funcion cargarDistrito 	 
	    	 */	    	 
			var prov = document.Rcliente.cbxProvincia.value;  
			var dept = document.Rcliente.cbxDepartamento.value;    		
    		$('#dis').load('cargarDistritoCliente?prov='+prov+'&dept='+dept);
		}             
	</script>

<script type="text/javascript">
		/* COMIENZA EL SCRIPT DEL RELOJ */
		function actualizaReloj(){
    		/* CAPTURAMOS LA HORA, LOS MINUTOS Y LOS SEGUNDOS */
    		marcacion = new Date()
    		/* CAPTURAMOS LA HORA */
    		Hora = marcacion.getHours()
    		/* CAPTURAMOS LOS MINUTOS */
    		Minutos = marcacion.getMinutes()
    		/* CAPTURAMOS LOS SEGUNDOS */
    		Segundos = marcacion.getSeconds()
    		/* SI LA HORA, LOS MINUTOS O LOS SEGUNDOS SON MENORES O IGUALES A 9, LE AÑADIMOS UN 0 */
    		if (Hora<=9)
       		 	Hora = "0" + Hora

    		if (Minutos<=9)
    	    	Minutos = "0" + Minutos

   		 	if (Segundos<=9)
    	    	Segundos = "0" + Segundos
    		/* TERMINA EL SCRIPT DEL RELOJ */
    		/* COMIENZA EL SCRIPT DE LA FECHA */
    		var Dia = new Array("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado","Domingo");
    		var Mes = new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Setiembre","Octubre","Noviembre","Diciembre");
    		var Hoy = new Date();
    		var Anio = Hoy.getFullYear();
    		var Fecha = " ► " + Dia[Hoy.getDay()] + ", " + Hoy.getDate() + " de " + Mes[Hoy.getMonth()] + " del " + Anio + " ► ";
    		/* TERMINA EL SCRIPT DE LA FECHA */
    		/* CREAMOS 4 VARIABLES PARA DARLE FORMATO A NUESTRO SCRIPT */
    		var Script,Total
    		/* EN RELOJ LE INDICAMOS LA HORA, LOS MINUTOS Y LOS SEGUNDOS */
    		Script = Fecha + Hora + ":" + Minutos + ":" + Segundos;
    		/* EN FINAL CERRAMOS EL TAG DE LA FUENTE */
    		//Final = " "
    		/* EN TOTAL FINALIZAMOS EL RELOJ UNIENDO LAS VARIABLES */
    		Total = Script
    		/* CAPTURAMOS UNA CELDA PARA MOSTRAR EL RELOJ */
    		document.getElementById('Fecha_Reloj').innerHTML = Total
    		/* INDICAMOS QUE NOS REFRESQUE EL RELOJ CADA 1 SEGUNDO */
    		setTimeout("actualizaReloj()",1000)
		}
	</script>

<script>
		$("#animacion").ready(function(){
        	actualizaReloj();
            //IniciarSecuencia();
		});
    </script>

<script type="text/javascript">
		function ucwords(string){
			var arrayWords;
        	var returnString = "";
        	var len;
        	arrayWords = string.split(" ");
        	len = arrayWords.length;
        	for(i=0;i < len ;i++){
        		if(i != (len-1)){
					returnString = returnString+ucFirst(arrayWords[i])+" ";
        	  	}
        	  	else{
        	   		returnString = returnString+ucFirst(arrayWords[i]);
        	  	}
			}
        	return returnString;
        	}
        	function ucFirst(string){
				return string.substr(0,1).toUpperCase()+string.substr(1,string.length).toLowerCase();
		}
	</script>

<script type="text/javascript">
		function justNumbers(e){
			var keynum = window.event ? window.event.keyCode : e.which;
        	if ((keynum == 8) || (keynum == 46))
				return true;
         	return /\d/.test(String.fromCharCode(keynum));
        }
	</script>

<script type="text/javascript">

		/*function prueba(){
			var p = $('#marca_destino').selectedIndex = 0;
			alert(p);
		}*/
		
		function buscaTarifa(){				
			var usuario = document.Rtarifa.txtUsuario.value;
			$('#tarifaAsignar').load('buscaProveedor?usuario='+usuario);
		}
		
		function busca_marca(){				
			var proveedor = document.Rbuscar_marcas.txtUsuario.value;
			var id_proveedor = document.Rbuscar_marcas.txtCodigo.value;
			//alert ("El codigo es: " + usuario);
			$('#sinmarcas').load('sinmarcas?proveedor='+proveedor+'&id_proveedor='+id_proveedor);
			$('#conmarcas').load('conmarcas?proveedor='+proveedor+'&id_proveedor='+id_proveedor);
		
		}
	
		function busca(){				
			var usuario = document.Rbuscar.txtUsuario.value;
			//alert ("El codigo es: " + usuario);
			$('#nombreAsignar').load('buscaAsignar?usuario='+usuario);
			$('#sinperfil').load('sinperfil?usuario='+usuario);
			$('#conperfil').load('conperfil?usuario='+usuario);
		}

		function cambiaSoles(){
			var tarifa = document.Rtarifa.txtTarifa.value;
			var moneda = document.Rtarifa.rtipMdneda.value;
			var dolar = document.Rtarifa.txtDolar.value;
			//alert ("La tarifa es: "+tarifa+"\n"+"Moneda: "+moneda+"\n"+"dolar: "+dolar+"\n"+"tipo: "+tipo);
			$('#soles').load('calculaSoles?tarifa='+tarifa+'&moneda='+moneda+'&dolar='+dolar);
		}
	</script>

<script>
	$(document).ready(function() {
		//$("#test-upload").fileinput();
	} );

	$().ready(function() {
		$('.pasar').click(function() { return !$('#origen option:selected').remove().appendTo('#destino'); });  
		$('.quitar').click(function() { return !$('#destino option:selected').remove().appendTo('#origen'); });
		$('.submit').click(function() { $('#destino option').prop('selected', 'selected'); });
	});	
	</script>
<script>
	
	$().ready(function() {
		$('.pasar').click(function() { return !$('#marca_origen option:selected').remove().appendTo('#marca_destino'); });  
		$('.quitar').click(function() { 
			return !$('#marca_destino option:selected').remove().appendTo('#marca_origen');							
		});
		$('.pasartodos').click(function() { $('#marca_origen option').each(function(){
			$(this).remove().appendTo('#marca_destino');}); });
		$('.quitartodos').click(function() { $('#marca_destino option').each(function(){
			$(this).remove().appendTo('#marca_origen');});});
		$('#guardar').click(function() { 
			//$('#marca_destino option').prop('selected', 'selected');
			$('#marca_destino option').prop("selected", true);			 
		});		
	});	
</script>
</head>